/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.kh.pi.Log;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 *
 * @author phamt_000
 */
public class Log implements com.kh.pi.Interface.ILog{
    BufferedWriter out;
    DateFormat dateFormat; 
    //Contructor
    public void Log() throws IOException{
        out= new BufferedWriter(new FileWriter("Log.txt"));
        dateFormat= new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
    }
    @Override
    public void WriteException(String sError) throws IOException{
        Date date = new Date();
        out.write("["+dateFormat.format(date)+"]: "+sError);
        out.newLine();
        out.close();
    }
}
